<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="cms" uri="http://cms.gxsoft.com/tags-cms"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>添加新闻</title>
<link href="<%=request.getContextPath()%>/css/reset.css" rel="stylesheet" type="text/css"/>
<link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css"/>
<script language="javascript" src="<%=request.getContextPath()%>/js/meizzDate.js"></script>
<script language="javascript" src="<%=request.getContextPath()%>/js/beforeClose.js"></script>
<script type="text/javascript">

	function selectEmployer(){
		var arr = showModalDialog("<%=request.getContextPath()%>/EmployerInfo.do?method=find", "", "dialogWidth:550pt;dialogHeight:400pt;help:0;status:0");
		if(arr != null){
			var id = arr[0][0];
			var name = arr[0][1];
			document.form1.petitionInfoReportedUnit.value = id;
			document.form1.unit.value = name;
		}
	}
	
	function changeNum(){
		var frm = document.form1;
		if(frm.petitionInfoIfGroupP.value=="1"){
			frm.petitionInfoPNum.disabled = true;
			frm.petitionInfoPNum.value ="1";
			}
		else{
			frm.petitionInfoPNum.disabled = false;
		}
		
	}
		
	function check(){
		var frm = document.form1;
		if(frm.petitionInfoTime.value == ""){
			alert("请选择信访时间！");
			return false;
		}
		if(frm.petitionInfoResion.value == ""){
			alert("请选择上访原因！");
			return false;
		}
		if(frm.petitionInfoReportedUnit.value == ""){
			alert("请选择被举报单位！");
			return false;
		}
		if(frm.petitionInfoScope.value == ""){
			alert("请选择上访规模！");
			return false;
		}
		if(frm.petitionInfoType.value == ""){
			alert("请选择信访类型！");
			return false;
		}
		if(frm.petitionInfoMode.value == ""){
			alert("请选择访问方式！");
			return false;
		}
		if(frm.petitionInfoSource.value == ""){
			alert("请选择信访来源！");
			return false;
		}
		if(frm.petitionInfoPNum.value == ""){
			alert("请输入上访人数！");
			frm.petitionInfoPNum.focus();
			return false;
		}
		
		if(isNaN(frm.petitionInfoPNum.value)){
			alert("输入的上访人数必须位数字！");
			frm.petitionInfoPNum.focus();
			return false;
		}
		
		if(frm.petitionInfoCircs.value == ""){
			alert("请选择处理情况！");
			return false;
		}
		changeLoadPage();
	}
</script>
</head>

<body>
<form action="<%=request.getContextPath()%>/VisiteInfo.do?method=update&vid=${vInfo.petitionInfoId }" name="form1" method="post" onsubmit="return check()">
<input type="hidden" name="pages" value="${nowPage}"/>
<table width="100%">
 <tr>
 	<td align="right" class="bg_blue">信访登记号：</td>
    <td > ${vInfo.petitionInfoRegister } </td>
    <td width="20%" align="right" class="bg_blue"><font color="red">*</font>&nbsp;&nbsp;信访时间：</td>
    <td width="30%"><input name="petitionInfoTime" onclick="SelectDate(this,'yyyy-MM-dd')" readonly value="<fmt:formatDate pattern="yyyy-MM-dd" value="${vInfo.petitionInfoTime}"/>" type="text" class="input" id="lxdh" size="20" maxlength="40" /></td>
  </tr>
  <tr>
  	<td align="right" class="bg_blue"><font color="red">*</font>&nbsp;&nbsp;上访原因：</td>
     <td  align="left" > <cms:selectAll dataType="012" name="petitionInfoResion" firstTitle="请选择.." key="${vInfo.petitionInfoResion}"></cms:selectAll></td>
    <td align="right" class="bg_blue"><font color="red">*</font>&nbsp;&nbsp;被举报单位：</td>
    <td align="left" ><input type="hidden" name="petitionInfoReportedUnit" value="${vInfo.employerInfo.empInfoId }"><input type="text" name="unit" size="20" readonly onClick="javascript:selectEmployer()" value="${vInfo.employerInfo.empInfoName }"> <input class="buttonadd" type="button" value="选择" onClick="javascript:selectEmployer()">&nbsp;</td>
  </tr>
  <tr>
  	<td align="right" class="bg_blue"><font color="red">*</font>&nbsp;&nbsp;上访规模：</td>
    <td  align="left" > <cms:selectAll dataType="013" name="petitionInfoScope" firstTitle="请选择.." key="${vInfo.petitionInfoScope}"></cms:selectAll></td>
    <td align="right" class="bg_blue"><font color="red">*</font>&nbsp;&nbsp;类型：</td>
    <td>
        <cms:selectAll dataType="006" name="petitionInfoType" firstTitle="请选择.." key="${vInfo.petitionInfoType}"></cms:selectAll></td>
  </tr>
  <tr>
  	<td align="right" class="bg_blue"><font color="red">*</font>&nbsp;&nbsp;访问方式：</td>
    <td>
    <select name="petitionInfoMode">
    <option value="">请选择</option>
    <option value="0" <c:if test="${vInfo.petitionInfoMode == '0'}">selected</c:if>>来信</option><option value="1" <c:if test="${vInfo.petitionInfoMode == '1'}">selected</c:if>>来访</option></select>
     <td align="right" class="bg_blue">联名信(集体访)：</td>
    <td><select name="petitionInfoIfGroupP" onchange="changeNum();">
    <option value="0" <c:if test="${vInfo.petitionInfoIfGroupP == '0'}">selected</c:if>>是</option><option value="1" <c:if test="${vInfo.petitionInfoIfGroupP == '1'}">selected</c:if>>否</option>
    </select>
    </td>
   
  </tr>
  <tr>
    <td align="right" class="bg_blue"><font color="red">*</font>&nbsp;&nbsp;信访来源：</td>
    <td> <cms:selectAll dataType="011" name="petitionInfoSource" firstTitle="请选择.." key="${vInfo.petitionInfoSource}"></cms:selectAll></td>
     <td align="right" class="bg_blue"><font color="red">*</font>&nbsp;&nbsp;上访人数：</td>
    <td><input name="petitionInfoPNum" value="${vInfo.petitionInfoPNum }" class="input" id="lxdh"  maxlength="50" <c:if test="${vInfo.petitionInfoIfGroupP == '1'}">disabled</c:if>/></td>
  </tr>
  <tr>
    <td align="right" class="bg_blue"><font color="red">*</font>&nbsp;&nbsp;处理情况：</td>
    <td><select name="petitionInfoCircs"><option value="">请选择</option>
    <option value="0" <c:if test="${vInfo.petitionInfoCircs == '0'}">selected</c:if>>未处理</option><option value="1" <c:if test="${vInfo.petitionInfoCircs == '1'}">selected</c:if>>已处理</option></select>
     <td align="right" class="bg_blue">持续时间：</td>
    <td ><input name="petitionInfoGoonTime" value="${vInfo.petitionInfoGoonTime }" class="input" id="bt" maxlength="100" /></td>
  </tr>
  <tr>
  	<td align="right" class="bg_blue">处理方式：</td>
    <td><input name="petitionInfoDealMode" value="${vInfo.petitionInfoDealMode }" class="input" id="bt"  maxlength="100" /></td>
    <td align="right" class="bg_blue">处理单位：</td>
    <td  align="left" ><input type="text" name="petitionInfoCompany" value="${vInfo.petitionInfoCompany }"></td>
  </tr>
  <tr>
    <td align="right" class="bg_blue">内容：</td>
    <td colspan="4"  align="left" valign="top"><textarea name="petitionInfoContent" cols="70" rows="10" id="nr">${vInfo.petitionInfoContent}</textarea>
    </td>
  </tr>
  <tr>
    <td align="right" class="bg_blue">处理结果：</td>
    <td colspan="4"  align="left" valign="top"><textarea name="petitionInfoDealResult" cols="70" rows="10" id="nr">${vInfo.petitionInfoDealResult}</textarea>
    </td>
  </tr>
  <tr>
    <td colspan="4" align="center" class="nohover">
    <input type="submit" class="buttonsubmit" onClick="" value="提交"/>&nbsp;
     <input type="reset" class="buttonreset" value="重置"/>
    <input type="button" class="buttonreturn" onClick="history.back(-1);" value="返回"/></td>
  </tr>
</table>
</form>
</body>
</html>
